package cn.base.day11.day1101;

import java.util.HashMap;
import java.util.Set;

public class Test02 {
    public static void main(String[] args) {
        Animal a = new Cat();
        HashMap<String, String> a1 = new HashMap<>();
        //添加
        a1.put("age", "15");
        a1.put("name", "李四");
        // System.out.println(a1);

        //修改
        a1.put("age", "18");
        // System.out.println(a1);

        //删除
        a1.remove("age");
        System.out.println(a1);

        //查看
        System.out.println(a1.get("name"));

        //增强for 遍历map集合
        Set<String> keys = a1.keySet();
        for (String k : keys) {
            String v = a1.get(k);
            System.out.println(k + "--" + v);
        }


    }
}
